﻿<!DOCTYPE html>
<html>
<head>
    <title>应用编辑</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">


    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link href="/ViewV5/CSS/bootstrap3.3.5/css/bootstrap.min.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="/ViewV5/CSS/animate.css">
    <link rel="stylesheet" type="text/css" href="/ViewV5/CSS/index.css?v=1">
    <link rel="stylesheet" type="text/css" href="/ViewV5/CSS/default.css">
    <link href="/ViewV5/CSS/element/index.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="/ViewV5/CSS/FORMBI.css?v=2">
    <link rel="stylesheet" href="http://at.alicdn.com/t/font_533449_naak7odp5x.css" />
    <style>

        .el-button-group button {
            border-radius: 0px;
        }

        .widthmax {
            width: 100%;
        }

        .pd40 {
            padding: 40px;
        }

        .pd0 {
            padding: 0;
        }
    </style>

    <style>
        .caption {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .yy .col-md-2 {
            width: auto !important;
        }

        .card {
            border: 1px solid #eee;
            -webkit-transition: all .5s ease-in-out;
            -moz-transition: all .2s ease-in-out;
            transition: all .2s ease-in-out;
            width: 100PX;
            padding: 5PX;
        }

        .delyy {
            color: red;
            POSITION: ABSOLUTE;
            RIGHT: 10PX;
            TOP: -10PX;
            FONT-SIZE: 18PX;
            cursor: pointer;
            visibility: collapse;
        }

        .card:hover {
            box-shadow: 0px 2px 8px #3252f1;
            cursor: pointer;
            -webkit-transition: all .5s ease-in-out;
            -moz-transition: all .2s ease-in-out;
            transition: all .2s ease-in-out;
        }

        .col-md-2:hover .delyy {
            visibility: visible;
        }

        img {
            border-radius: 50%;
        }

        h5 {
            FONT-WEIGHT: 700;
            MARGIN-TOP: 2PX;
        }
    </style>
</head>
<body class="BG">

    <div id="Loading">
        <div class="loader-inner ball-beat">
            <div></div>
            <div></div>
            <div></div>
        </div>
    </div>
    <div id="DATABI_DSETZZ" class="FormV" style="display: none">


        <el-container>

            <el-main class="elmain pd40">
                <div class="panel-df">
                    <div class="container containerb" style="padding:0;width:96%">
                        <div class="panel panel-defaul  panhead">


                            <el-row>
                                <el-col :xs="24" :sm="24">
                                    <h4 class="text-center" style="font-size:20PX;font-weight:bolder">
                                        <span v-text="FormData.ModelName"></span>
                                    </h4>
                                    <div style="text-align:right;">
                                        <el-button type="success" ref="btAdd" @click="StarForm" style="border-radius:0px;"> <i class="iconfont icon-faqi"></i><span>保存信息</span></el-button>


                                        <el-button type="success" ref="btDC" @click="dcyyjb" style="border-radius:0px;"> <i class="iconfont icon-faqi"></i><span>导出应用脚本</span></el-button>
                                    </div>

                                </el-col>
                            </el-row>

                        </div>

                        <div class="panel panel-default panbody" style="padding:0" v-loading="loading" element-loading-text="拼命处理中...">
                            <div class="success" v-show="formtatus =='1'">
                                <div class="success-tip">
                                    操作信息提示
                                    <i></i>
                                </div>
                                <div class="icon-tip">
                                    <div class="success-icon">
                                        <img src="/ViewV5/images/xt-right.png" />
                                    </div>
                                    <p></p>
                                </div>

                                <div class="tip-mesg">
                                </div>
                            </div>

                            <el-tabs v-model="activeName" type="border-card" v-show="formtatus =='0'">
                                <el-tab-pane label="基本属性" name="0">
                                    <el-form ref="FormData" label-position="top" :model="FormData">
                                        <el-col :md="12" style="    margin-bottom: 10px;padding-right:10px">
                                            <el-form-item label="父应用代码">
                                                <el-input type="text" v-model="FormData.PModelCode"></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :md="12" style="    margin-bottom: 10px;padding-left:10px">
                                            <el-form-item label="父应用类型">
                                                <el-input type="text" v-model="FormData.ModelType"></el-input>


                                            </el-form-item>
                                        </el-col>
                                        <el-col :md="12" style="    margin-bottom: 10px;padding-right:10px">
                                            <el-form-item label="应用名称">
                                                <el-input type="text" v-model="FormData.ModelName"></el-input>


                                            </el-form-item>
                                        </el-col>
                                        <el-col :md="12" style="    margin-bottom: 10px;padding-left:10px">
                                            <el-form-item label="应用代码">
                                                <el-input type="text" v-model="FormData.ModelCode"></el-input>


                                            </el-form-item>
                                        </el-col>
                                        <el-col :md="12" style="    margin-bottom: 10px;padding-right:10px">
                                            <el-form-item label="排序">
                                                <el-input type="text" v-model="FormData.ORDERID"></el-input>


                                            </el-form-item>
                                        </el-col>
                                        <el-col :md="12" style="    margin-bottom: 10px;padding-left:10px">
                                            <el-form-item label="应用图标">
                                                <el-input placeholder="请输入内容" v-model="FormData.ModePicUrl" class="input-with-select">
                                                    <el-button slot="append" icon="el-icon-search" v-popover:popover></el-button>
                                                </el-input>
                                                <el-popover placement="left"
                                                            width="400"
                                                            trigger="click"
                                                            ref="popover">
                                                    <el-row :gutter="10">
                                                        <el-col :span="4" class="mb10" v-for="(icon,dlindex) in iconlist">
                                                            <i :class="'iconfont '+icon.name" @click="seltb(icon)" style="font-size:30px;cursor:pointer"></i>
                                                        </el-col>
                                                    </el-row>
                                                </el-popover>
                                            </el-form-item>
                                        </el-col>
                                        <!--<el-col :md="12" style="    margin-bottom: 10px;padding-right:10px">
                                            <el-form-item label="移动首页">
                                                <el-input type="text" v-model="FormData.WXUrl"></el-input>


                                            </el-form-item>
                                        </el-col>-->
                                    </el-form>
                                </el-tab-pane>
                                <el-tab-pane label="页面列表" name="1">
                                    <p>主要包含2类，一类是菜单，会显示在系统左侧，一类是非菜单，用于其它方式打开的页面，例如Tab方式</p>
                                    <el-table :data="FunData"
                                              border
                                              style="width: 100%" class="mt10">

                                        <el-table-column prop="PageName"
                                                         label="页面名称"
                                                         width="140">
                                            <template slot-scope="scope">
                                                <el-input v-model="scope.row.PageName"></el-input>
                                            </template>
                                        </el-table-column>
                                        <el-table-column prop="PageCode"
                                                         label="页面路径">
                                            <template slot-scope="scope">
                                                <el-input v-model="scope.row.PageCode" :disabled="islisttemp(scope.row)"></el-input>
                                            </template>
                                        </el-table-column>
                                        <el-table-column prop="FunOrder"
                                                         label="排序"
                                                         width="120" sortable>
                                            <template slot-scope="scope">
                                                <el-input v-model="scope.row.FunOrder"></el-input>
                                            </template>
                                        </el-table-column>
                                        <el-table-column prop="isiframe"
                                                         label="是否iframe"
                                                         width="120">
                                            <template slot-scope="scope">
                                                <el-input v-model="scope.row.isiframe" :disabled="islisttemp(scope.row)"></el-input>
                                            </template>
                                        </el-table-column>
                                        <el-table-column prop="PageUrl"
                                                         label="是否作为菜单"
                                                         width="150" sortable>
                                            <template slot-scope="scope">
                                                <el-switch v-model="scope.row.PageUrl" active-value="0" inactive-value="1" style="width:100%">
                                            </template>
                                        </el-table-column>
                                        <el-table-column label="操作" fixed="right" align="center" width="100">
                                            <template slot-scope="scope">
                                                <el-button @click.native.prevent="delRow(scope.$index,FunData,scope.row)"
                                                           type="text"
                                                           size="small">
                                                    删除
                                                </el-button>
                                                <el-button @click.native.prevent="setlist(scope.row)" v-if="islisttemp(scope.row)"
                                                           type="text"
                                                           size="small">
                                                    配置项
                                                </el-button>

                                            </template>
                                        </el-table-column>

                                    </el-table>
                                    <el-button type="primary" size="mini" class="mt10 pull-right" @click="addListRow">添加列表模板页<i class="el-icon-plus"></i></el-button>

                                    <el-button type="warning" size="mini" class="mt10 pull-right" style="margin-right:10PX" @click="addRow">添加普通页面<i class="el-icon-plus"></i></el-button>
                                </el-tab-pane>
                                <el-tab-pane label="应用配置" name="3">
                                    <div class="main-content ft16  c666 padding20 yy">
                                        <!--<h3 class="text-center" v-text="FormData.ModelName"></h3>-->




                                        <div class="col-md-12 mb10">
                                            <h4 class="title ft16" style=" FONT-WEIGHT: 700;border-left: 3px solid #12b8f6;text-indent: 0.5em;display: inline-block;">物理表</h4>
                                        </div>
                                        <div class="col-md-2" v-for="(item, index) in tabledata" v-popover:popover>
                                            <i class="el-icon-error delyy" v-on:click.stop="deltab(item,index)"></i>
                                            <div class="thumbnail card" @click="mgtab(item)">
                                                <img src="/ViewV5/images/icon/1.png" style="height: 60px; width: 60px; display: block; ">
                                                <div class="caption text-center" style="padding: 4px;">
                                                    <h5 v-text="item.TableDesc"></h5>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-2">
                                            <div class="thumbnail card" @click="addtab()">
                                                <img src="/ViewV5/images/icon/Common.png" style="height: 60px; width: 60px; display: block; ">
                                                <div class="caption text-center" style="padding: 4px;">
                                                    <h5>新增</h5>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-2">
                                            <div class="thumbnail card" @click="showdrtab()">
                                                <img src="/ViewV5/images/icon/Common.png" style="height: 60px; width: 60px; display: block; ">
                                                <div class="caption text-center" style="padding: 4px;">
                                                    <h5>导入</h5>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-12 mb10">
                                            <h4 class="title ft16" style=" FONT-WEIGHT: 700;border-left: 3px solid #12b8f6;text-indent: 0.5em;display: inline-block;">数据集</h4>
                                        </div>
                                        <div class="col-md-2" v-for="(item, index) in datasetdata">
                                            <i class="el-icon-error delyy" v-on:click.stop="delset(item,index)"></i>

                                            <div class="thumbnail card" @click="mgset(item)">
                                                <img src="/ViewV5/images/icon/1.png" style="height: 60px; width: 60px; display: block; ">
                                                <div class="caption text-center" style="padding: 4px;">
                                                    <h5 v-text="item.Name"></h5>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-2">
                                            <div class="thumbnail card" @click="addset()">
                                                <img src="/ViewV5/images/icon/Common.png" style="height: 60px; width: 60px; display: block; ">
                                                <div class="caption text-center" style="padding: 4px;">
                                                    <h5>添加</h5>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-12 mb10">
                                            <h4 class="title ft16" style=" FONT-WEIGHT: 700;border-left: 3px solid #12b8f6;text-indent: 0.5em;display: inline-block;">自定义表单</h4>
                                        </div>
                                        <div class="col-md-2" v-for="(item, index) in formdatain">
                                            <i class="el-icon-error delyy" v-on:click.stop="delform(item,index)"></i>
                                            <div class="thumbnail card" @click="mgform(item)">
                                                <img src="/ViewV5/images/icon/1.png" style="height: 60px; width: 60px; display: block; ">
                                                <div class="caption text-center" style="padding: 4px;">
                                                    <h5 v-text="item.ProcessName"></h5>
                                                    <!--<p class="ft12" style="margin-top: 2px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;" v-text="item.mc"> </p>-->
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-2">
                                            <div class="thumbnail card" @click="addform()">
                                                <img src="/ViewV5/images/icon/Common.png" style="height: 60px; width: 60px; display: block; ">
                                                <div class="caption text-center" style="padding: 4px;">
                                                    <h5>添加</h5>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-12 mb10">
                                            <h4 class="title ft16" style=" FONT-WEIGHT: 700;border-left: 3px solid #12b8f6;text-indent: 0.5em;display: inline-block;">BI报表</h4>
                                        </div>
                                        <div class="col-md-2" v-for="(item, index) in ybdata">
                                            <i class="el-icon-error delyy" v-on:click.stop="delyb(item,index)"></i>
                                            <div class="thumbnail card" @click="mgyb(item)">
                                                <img src="/ViewV5/images/icon/1.png" style="height: 60px; width: 60px; display: block; ">
                                                <div class="caption text-center" style="padding: 4px;">
                                                    <h5 v-text="item.Name"></h5>
                                                    <!--<p class="ft12" style="margin-top: 2px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;" v-text="item.mc"> </p>-->
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-2">
                                            <div class="thumbnail card" @click="addyb()">
                                                <img src="/ViewV5/images/icon/Common.png" style="height: 60px; width: 60px; display: block; ">
                                                <div class="caption text-center" style="padding: 4px;">
                                                    <h5>添加</h5>
                                                </div>
                                            </div>
                                        </div>


                                        <div class="modal fade" id="TabModal" role="dialog">
                                            <div class="modal-dialog" role="document" style="width: 700px">
                                                <div class="modal-content">
                                                    <div class="modal-header">
                                                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                                        <h4 class="modal-title">添加表</h4>
                                                    </div>
                                                    <div class="modal-body">
                                                        <div class="form-horizontal">
                                                            <div class="form-group">
                                                                <label for="branchName" class="col-xs-3 control-label text-right">数据源</label>
                                                                <div class="col-xs-7">
                                                                    <select id="DTS" class="form-control">
                                                                        <option value="0">本地数据源</option>
                                                                        <option v-for="item in DSourData" :value="item.ID">{{item.Name}}</option>
                                                                    </select>
                                                                </div>
                                                            </div>
                                                            <div class="form-group">
                                                                <label for="branchName" class="col-xs-3 control-label text-right">表名称(数据库表名)</label>
                                                                <div class="col-xs-7">
                                                                    <div class="input-group">
                                                                        <span class="input-group-addon" id="basic-addon1">qj_</span>
                                                                        <input type="text" class="form-control" id="BName" placeholder="表名称" />

                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group">
                                                                <label for="branchName" class="col-xs-3 control-label text-right">表别名</label>
                                                                <div class="col-xs-7">
                                                                    <div class="input-group">
                                                                        <input type="text" class="form-control" id="BBName" placeholder="表别名" />

                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="modal-footer">
                                                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                                        <button type="button" class="btn btn-info" @click="savetab()">确认</button>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="modal fade" id="DetModal" role="dialog">
                                            <div class="modal-dialog" role="document" style="width: 700px">
                                                <div class="modal-content">
                                                    <div class="modal-header">
                                                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                                        <h4 class="modal-title">添加数据集</h4>
                                                    </div>
                                                    <div class="modal-body">
                                                        <div class="form-horizontal">

                                                            <div class="form-group">
                                                                <label for="branchName" class="col-xs-3 control-label text-right">数据集名称</label>
                                                                <div class="col-xs-7">
                                                                    <input type="text" class="form-control" id="DSName" placeholder="数据集名称" />
                                                                </div>
                                                            </div>
                                                            <div class="form-group">
                                                                <label for="branchName" class="col-xs-3 control-label text-right">数据源</label>
                                                                <div class="col-xs-7">
                                                                    <select id="DTSSET" class="form-control">
                                                                        <option value="0">本地数据源</option>
                                                                        <option v-for="item in DSourData" :value="item.ID">{{item.Name}}</option>
                                                                    </select>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="modal-footer">
                                                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                                        <button type="button" class="btn btn-info" @click="saveset()">确认</button>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="modal fade" id="YBModal" role="dialog">
                                            <div class="modal-dialog" role="document" style="width: 700px">
                                                <div class="modal-content">
                                                    <div class="modal-header">
                                                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                                        <h4 class="modal-title">添加仪表盘</h4>
                                                    </div>
                                                    <div class="modal-body">
                                                        <div class="form-horizontal">
                                                            <div class="form-group">
                                                                <label for="branchName" class="col-xs-3 control-label text-right">报表名称</label>
                                                                <div class="col-xs-7">
                                                                    <input type="text" class="form-control" id="YBName" placeholder="报表名称" />
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="modal-footer">
                                                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                                        <button type="button" class="btn btn-info" @click="saveyb()">确认</button>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="modal fade" id="TabModal1" role="dialog">
                                            <div class="modal-dialog" role="document" style="width: 700px">
                                                <div class="modal-content">
                                                    <div class="modal-header">
                                                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                                        <h4 class="modal-title">导入现有表</h4>
                                                    </div>
                                                    <div class="modal-body">
                                                        <div class="form-horizontal">
                                                            <div class="form-group">
                                                                <label for="branchName" class="col-xs-3 control-label text-right">数据源</label>
                                                                <div class="col-xs-7">
                                                                    <select id="DTS1" class="form-control">
                                                                        <option value="0">本地数据源</option>
                                                                        <option v-for="item in DSourData" :value="item.ID">{{item.Name}}</option>
                                                                    </select>
                                                                </div>
                                                            </div>

                                                            <div class="form-group">
                                                                <label for="branchName" class="col-xs-3 control-label text-right">表名称(数据库表名)</label>
                                                                <div class="col-xs-7">
                                                                    <div class="input-group">
                                                                        <input type="text" class="form-control" id="BName1" placeholder="表名称" />
                                                                        <span class="input-group-addon hide" id="basic-addon1">qj_</span>


                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group">
                                                                <label for="branchName" class="col-xs-3 control-label text-right">表别名</label>
                                                                <div class="col-xs-7">
                                                                    <div class="input-group">
                                                                        <input type="text" class="form-control" id="BBName1" placeholder="表别名" />

                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="modal-footer">
                                                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                                        <button type="button" class="btn btn-info" @click="drtable()">确认</button>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                    </div>
                                </el-tab-pane>
                                <el-tab-pane label="移动端菜单" name="2">

                                    <el-table :data="MenuData"
                                              border
                                              style="width: 100%" class="mt10">
                                        <el-table-column prop="PageName"
                                                         label="页面名称"
                                                         width="140">
                                            <template slot-scope="scope">
                                                <el-input v-model="scope.row.PageName"></el-input>
                                            </template>
                                        </el-table-column>
                                        <el-table-column prop="PageCode"
                                                         label="页面路径">
                                            <template slot-scope="scope">
                                                <el-input v-model="scope.row.PageCode"></el-input>
                                            </template>
                                        </el-table-column>
                                        <el-table-column prop="FunOrder"
                                                         label="排序"
                                                         width="120" sortable>
                                            <template slot-scope="scope">
                                                <el-input v-model="scope.row.FunOrder"></el-input>
                                            </template>
                                        </el-table-column>


                                        <el-table-column label="操作" fixed="right" align="center" width="100">
                                            <template slot-scope="scope">
                                                <el-button @click.native.prevent="delRow(scope.$index,MenuData,scope.row)"
                                                           type="text"
                                                           size="small">
                                                    删除
                                                </el-button>

                                            </template>
                                        </el-table-column>

                                    </el-table>
                                    <el-button type="primary" size="mini" class="mt10 pull-right" @click="addMenu">添加行<i class="el-icon-plus"></i></el-button>
                                </el-tab-pane>

                            </el-tabs>


                        </div>

                        <div class="panel panel-default panwf " style="margin-bottom: 0px;">
                            <el-row>
                                <el-col :xs="24" :sm="24">
                                    <div style="text-align:right;">

                                        <el-button type="success" ref="btAdd" @click="StarForm" style="border-radius:0px;"> <i class="iconfont icon-faqi"></i><span>保存信息</span></el-button>
                                    </div>
                                </el-col>
                            </el-row>
                        </div>

                    </div>
                </div>
            </el-main>



        </el-container>

    </div>
    <script src="/ViewV5/JS/vue.js"></script>
    <script type="text/javascript" src="/ViewV5/JS/jquery-1.11.2.min.js"></script>
    <script src="/ViewV5/JS/lodash.min.js"></script>
    <script src="/ViewV5/JS/httpVueLoader.js"></script>
    <script src="/ViewV5/CSS/bootstrap3.3.5/js/bootstrap.js"></script>
    <!-- 引入组件库 -->
    <script src="/ViewV5/JS/element/element.js"></script>
    <script src="/ViewV5/JS/layer/layer.js"></script>
    <script src="/ViewV5/JS/bijs.js?v=4"></script>
    <script>
        var app = new Vue({
            el: '#DATABI_DSETZZ',

            data: {
                loading: true,
                formtatus: "0",
                activeName: "0",
                isshow: "1",
                dialogFormVisible: false,
                dataid: ComFunJS.getQueryString('ID', '0'),
                FunData: [],
                MenuData: [],
                iconlist: [
                    { "name": "icon-yingyongzongshu" }, { "name": "icon-faqihuiyi" }, { "name": "icon-zhengzhangshenqing" },
                    { "name": "icon-wupinlingyong" }, { "name": "icon-shujuji" }, { "name": "icon-zygl" },
                    { "name": "icon-chushihua" }, { "name": "icon-pifu1" }, { "name": "icon-time-last" },
                    { "name": "icon-kcgl" }, { "name": "icon-shijian1" }, { "name": "icon-shenpi1" },
                    { "name": "icon-lcsp" }, { "name": "icon-ccxj" }, { "name": "icon-ycgl" },
                    { "name": "icon-meeting" }, { "name": "icon-xmgl1" }, { "name": "icon-khlxr" },
                    { "name": "icon-xmgl" }, { "name": "icon-zuzhi" }, { "name": "icon-kdgl" },
                    { "name": "icon-model1" }, { "name": "icon-check1" }, { "name": "icon-cooperate" },
                    { "name": "icon-tkgl" }, { "name": "icon-peizhishujuyuan" }, { "name": "icon-faqi" },
                    { "name": "icon-upload" }, { "name": "icon-briefcase" }, { "name": "icon-faqihuiyi" },
                    { "name": "icon-dateboard" }, { "name": "icon-team" }, { "name": "icon-cloud" },
                    { "name": "icon-chengweijiangshi" }, { "name": "icon-tiaodongshenqing" }, { "name": "icon-canjiapeixun" }

                ],
                delfun: [],
                FormData: {

                },
                DSourData: [],
                tabledata: [],
                datasetdata: [],
                formdatain: [],
                ybdata: [],
                DSData: {}
            },
            //computed: {
            //    // 计算属性的 getter
            //    islisttemp: function () {
            //        // `this` 指向 vm 实例
            //        return this.message.split('').reverse().join('')
            //    }
            //},
            methods: {
                exportRaw: function (name, data) {
                    var urlObject = window.URL || window.webkitURL || window;
                    var export_blob = new Blob([data]);
                    var save_link = document.createElementNS("http://www.w3.org/1999/xhtml", "a")
                    save_link.href = urlObject.createObjectURL(export_blob);
                    save_link.download = name;
                    app.fakeClick(save_link);
                },
                fakeClick: function (obj) {
                    var ev = document.createEvent("MouseEvents");
                    ev.initMouseEvent("click", true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
                    obj.dispatchEvent(ev);
                },
                dcyyjb: function () {
                    app.loading = true;
                    $.getJSON("/api/Auth/ExeAction?Action=DCYYJB", { P1: app.dataid }, function (result) {
                        if (!result.ErrorMsg) {
                            var yydata = JSON.stringify(result.Result);
                            app.exportRaw(app.FormData.ModelName + ".json", yydata);
                            app.loading = false;
                        }
                    });
                },
                winconfirm: function (title, yes, no) {
                    layer.confirm(title, {
                        btn: ['确认', '取消'], //按钮
                        shade: false //不显示遮罩
                    }, function () {
                        layer.closeAll('dialog');
                        return yes.call(this);
                    }, function () {
                        return no && no.call(this);
                    });
                },
                seltb: function (icon) {
                    this.FormData.ModePicUrl = icon.name;
                },
                islisttemp: function (item) {

                    return item.PageCode.indexOf("baselist") > -1;
                },
                addRow: function () {
                    var temp = { PageCode: "", IsInit: "p" };
                    this.FunData.push(temp);

                },
                addListRow: function () {
                    var actiondata = [
                        { czname: '新增', isshow: false, issys: true, bttype: "success", jscode: "", isrowcz: "0" },
                        { czname: '批量删除', isshow: false, issys: true, bttype: "danger", jscode: "", isrowcz: "0" },
                        { czname: '编辑', isshow: false, issys: true, bttype: "text", jscode: "", isrowcz: "1" },
                        { czname: '删除', isshow: false, issys: true, bttype: "text", jscode: "", isrowcz: "1" }
                    ];
                    this.FunData.push(
                        { PageName: "", PageCode: "/ViewV5/Base/Vue/baselist", FunOrder: "0", IsInit: "p", isiframe: "N", islist: true, ActionData: JSON.stringify(actiondata) }
                    );
                },
                copRow: function (index, rows) {
                    var temp = JSON.stringify(rows[index]);
                    rows.splice(index, 0, JSON.parse(temp));

                },
                delRow: function (index, rows, row) {
                    if (row.ID) {
                        this.delfun.push(row.ID);
                    }
                    rows.splice(index, 1);
                },
                delMenu: function (index, rows, row) {
                    rows.splice(index, 1);
                },
                addMenu: function () {
                    var temp = { PageName: "", PageCode: "", FunOrder: "0", isiframe: "Y", IsInit: "m", islist: true, ActionData: JSON.stringify([]) }
                    this.MenuData.push(temp);

                },
                setlist: function (item) {
                    top.ComFunJS.winviewform("/ViewV5/AppPage/DataMange.html?ID=" + item.ID + "&PageCode=XTGL/Vue/listtemp", '管理', "1000", "");
                    //window.open("/ViewV5/AppPage/DataMange.html?ID=" + item.ID + "&PageCode=XTGL/Vue/listtemp")
                },
                StarForm: function () {
                    app.loading = true;
                    $.getJSON("/api/Auth/ExeAction?Action=SAVEYY", { P1: JSON.stringify(app.FormData), P2: JSON.stringify(app.FunData), DIDS: app.delfun.join(','), MENU: JSON.stringify(app.MenuData) }, function (result) {
                        if (!result.ErrorMsg) {
                            app.$notify({
                                title: '成功',
                                message: '操作成功',
                                type: 'success'
                            });
                            app.loading = false;
                            app.formtatus = "1";//成功状态
                            app.$refs.FormData.resetFields();


                        }
                    });
                },
                InitWF: function () {
                    $.getJSON("/api/Auth/ExeAction?Action=GETYY", { P1: app.dataid }, function (result) {
                        if (result.ErrorMsg == "") {
                            app.loading = false;
                            if (!result.Result.ModePicUrl) {
                                result.Result.ModePicUrl = "icon-yingyongzongshu";
                            }
                            app.FormData = result.Result;
                            _.forEach(result.Result1, function (obj) {
                                if (obj.PageUrl != '1') {
                                    obj.PageUrl = '0';
                                }
                            })
                            app.FunData = result.Result1;
                            app.MenuData = result.Result2;


                        }
                    })
                },
                //功能
                addtab: function () {
                    $('#TabModal').modal('show');
                },
                showdrtab: function () {
                    $('#TabModal1').modal('show');
                },
                mgtab: function (rowdata) {
                    window.open("/ViewV5/AppPage/DATABI/TABLEEDIT.html?id=" + rowdata.ID, "_blank");
                },
                deltab: function (item, index) {
                    var pro = this;
                    pro.winconfirm("确认要删除吗", function () {
                        $.getJSON('/api/Bll/ExeAction?Action=DATABI_DELTABLEDATA', { "P1": item.ID }, function (result) {
                            if (result.ErrorMsg == "") {
                                top.ComFunJS.winsuccess("删除成功");
                                pro.tabledata.splice(index, 1);
                            }
                        })
                    }, function () { })
                },
                savetab: function () {
                    if ($("#BName").val()) {
                        var pro = this;
                        $.getJSON('/api/Bll/ExeAction?Action=DATABI_ADDTABDATA', { P1: "qj_" + $("#BName").val(), DSID: $("#DTS").val(), SSMK: pro.dataid, P2: $("#BBName").val() }, function (resultData) {
                            if (resultData.ErrorMsg == "") {
                                top.ComFunJS.winsuccess("添加成功");
                                $('#TabModal').modal('hide');
                                pro.tabledata.push(resultData.Result)
                            }
                        })
                    } else {
                        top.ComFunJS.winwarning("表名称不能为空!");

                    }

                },
                drtable: function () {
                    if ($("#BName1").val()) {
                        var pro = this;
                        $.getJSON('/api/Bll/ExeAction?Action=DATABI_DRTABDATA', { P1: $("#BName1").val(), DSID: $("#DTS1").val(), SSMK: pro.dataid, P2: $("#BBName1").val() }, function (resultData) {
                            if (resultData.ErrorMsg == "") {
                                top.ComFunJS.winsuccess("添加成功");
                                $('#TabModal1').modal('hide');
                                pro.tabledata.push(resultData.Result)

                            }
                        })
                    } else {
                        top.ComFunJS.winwarning("表名称不能为空!");

                    }
                },
                addset: function () {
                    $('#DetModal').modal('show');
                },
                mgset: function (rowdata) {
                    window.open("/ViewV5/AppPage/DATABI/DSETEDIT.html?id=" + rowdata.ID, "_blank");
                },
                delset: function (item, index) {
                    var pro = this;
                    pro.winconfirm("确认要删除吗", function () {
                        $.getJSON('/api/Bll/ExeAction?Action=DATABI_DELBIDBSET', { "P1": item.ID }, function (result) {
                            if (result.ErrorMsg == "") {
                                top.ComFunJS.winsuccess("删除成功");
                                pro.datasetdata.splice(index, 1);
                            }
                        })
                    }, function () { })
                },
                saveset: function () {
                    var pro = this;
                    pro.DSData = { Name: $("#DSName").val(), SName: pro.FormData.ModelName, Type: pro.dataid, ID: "0", SID: $("#DTSSET").val() };
                    $.getJSON('/api/Bll/ExeAction?Action=DATABI_ADDBIDBSET', { P1: JSON.stringify(pro.DSData) }, function (resultData) {
                        if (resultData.ErrorMsg == "") {
                            top.ComFunJS.winsuccess("操作成功");
                            pro.datasetdata.push(resultData.Result)
                            $('#DetModal').modal('hide');

                        }
                    })
                },
                addform: function () {
                    var pro = this;
                    top.ComFunJS.winviewform("/ViewV5/AppPage/APP_ADD.html?FormCode=FORMBI_PROCESS&modelid=" + pro.dataid, "添加");
                },
                mgform: function (rowdata) {
                    window.open("/ViewV5/AppPage/FORMBI/FormBuildV1.html?id=" + rowdata.ID, "_blank");
                },
                delform: function (item, index) {
                    var pro = this;
                    pro.winconfirm("确认要删除吗", function () {
                        $.getJSON('/api/Bll/ExeAction?Action=FORMBI_DELPROCESSBYID', { P1: item.ID }, function (result) {
                            if (result.ErrorMsg == "") {
                                top.ComFunJS.winsuccess("删除成功");
                                pro.formdatain.splice(index, 1);
                            }
                        })
                    }, function () { })
                },

                addyb: function () {
                    $('#YBModal').modal('show');
                },
                mgyb: function (rowdata) {
                    window.open("/ViewV5/AppPage/DATABI/YBPBuild.html?id=" + rowdata.ID, "_blank");

                },
                delyb: function (item, index) {
                    var pro = this;
                    pro.winconfirm("确认要删除吗", function () {
                        $.getJSON('/api/Bll/ExeAction?Action=DATABI_DELYBDATA', { "P1": item.ID }, function (result) {
                            if (result.ErrorMsg == "") {
                                top.ComFunJS.winsuccess("删除成功");
                                pro.ybdata.splice(index, 1);
                            }
                        })
                    }, function () { })
                },
                saveyb: function () {
                    var pro = this;
                    $.getJSON('/api/Bll/ExeAction?Action=DATABI_SAVEDATA', { P1: $("#YBName").val(), P2: pro.FormData.ModelName, dim: pro.dataid, }, function (resultData) {
                        if (resultData.ErrorMsg == "") {
                            top.ComFunJS.winsuccess("添加成功");
                            pro.ybdata.push(resultData.Result)
                            $('#YBModal').modal('hide');
                        }
                    })
                },


                InitWigetData: function () {
                    var pro = this;
                    $.getJSON('/api/Auth/ExeAction?Action=GETINITDATA', { P1: pro.dataid }, function (resultData) {
                        if (resultData.ErrorMsg == "") {
                            pro.tabledata = resultData.Result;
                            pro.datasetdata = resultData.Result1;
                            pro.formdatain = resultData.Result2;
                            pro.ybdata = resultData.Result3;
                            pro.DSourData = resultData.Result4;

                        }
                    })
                },

            },
            mounted: function () {
                var pro = this;
                pro.$nextTick(function () {
                    pro.InitWF();
                    pro.InitWigetData();

                })
            },
            created() {
                document.body.removeChild(document.getElementById('Loading'))
                var divBJ = document.getElementById('DATABI_DSETZZ');
                divBJ.style.display = "block";
            }

        })


    </script>

</body>

</html>
